package com.smart.enums;

public enum  ReturnCodeEnum {
    SUCCESS(0,"成功"),
    FAILED(500,"网络不稳定,服务处理失败"),

    UN_BIND_PHONE(2001,"尚未绑定手机号"),
    UN_THIS_OIL(2002,"您不是本站员工，请到您所属的油站扫码"),
    UN_THIS_OIL_IS_SHOP(2003,"您是门店员工，无法扫描该二维码"),
    UN_THIS_OIL_IS_USER(2004,"您是我们的用户，若您已入职本油站，请联系管理员录入您的信息"),
    UN_USER_GET_ECP(3003,"对不起，您是我们的员工，不能领券"),
    UN_USER_USE_ECP(3005,"对不起，您是我们的员工，不能核销"),
    HAS_NO_SHOP_ECP_USER_SCAN(3004,"暂无商家可用电子券"),
    SEND_ECP_EXPIRE(3001,"二维码已过期，请联系工作人员重新领取"),
    HAS_BEEN_SEND(3002,"被领取失效"),
    USER_EXCEPTION(3006,"会员不存在或会员状态异常"),
    HAS_NO_INVENTORY(3007,"派券失败，可能是库存不足"),
    UN_SHOP_SCAN_ECP(4002,"对不起，您不是我们的员工，不能进行该操作"),
    HAS_USE(4003,"该优惠券已使用，无法再次核销"),
    DIFFERENT_MERCHANT(4004,"该优惠券所属商户与门店所属商户不匹配"),

    UN_SUBSCRIBE(1000,"未关注"),
    USER(1001,"普通用户"),
    SHOP(1002,"门店员工"),
    STATION(1003,"加油站员工"),
    CONFIRM_USE(1005,"确认核销页"),
    ECP_LIST(1004,"返回派券列表页"),
    SEND_ECP_SUCCESS(1006,"返回领取成功页"),
    SEND_AND_USE_ECP_SUCCESS(1007,"领取并核销成功");



    private int code;
    private String name;
    ReturnCodeEnum(int code, String name){
        this.code = code;
        this.name = name;
    }

    public static String getName(int code){
        for (ReturnCodeEnum obj : ReturnCodeEnum.values()) {
            if(obj.getCode() == code){
                return obj.getName();
            }
        }
        return "";
    }

    public String getName() {
        return name;
    }

    public int getCode() {
        return code;
    }
}
